output at flexible time levels#217
output at flexible time levels#217guoqing-noaa wants to merge 4 commits intoufs-community:gsl/developfrom
Conversation
…ttribute Introduce a new `output_timelevels` attribute for MPAS streams that enables variable output intervals. With this capability, we may outoput every 15 minutes in the first hour, every hour in the first 3 days, every 3 hours for the next 4 days, and every 6 hours in the last 3 days. We can also use this to only write out forecast files during a given period, such as: output_timelevels="6-12h" Check the PR description for details on how to specify the time levles. Here is a quick example: output_timelevels="0-3-15m 4-72 75-168-3 174-240-6"
|
|
The following situations have been tested: |
output_timelevels stream attrbute|
For a conus12km 12 hours forecasts, I tried different settings for the the |
SamuelTrahanNOAA
left a comment
There was a problem hiding this comment.
These code changes are overcomplicated and will be difficult to extend or maintain. Any significant changes to the functionality will require a complicated rewrite.
More specific overview comments:
- Most of the parser code is a reimplementation of the Fortran standard
splitfunction. It would be better to callsplit. - Much of the time-related code reimplements the MPAS and ESMF alarm functionality. It would be better to extend the alarm functionality.
- Parser errors aren't reported. If you type something wrong, you don't know what it was.
- There are out-of-bounds array reads due to off-by-one errors.
- The new syntax deviates from the MPAS days_HH:MM:SS time specification.
- Unlike the rest of the MPAS I/O interface, this uses a cryptic string instead of XML tags. If you used XML tags, the parser code wouldn't be necessary at all.
If you want to use a parser generator, the original grammar specification should be in the repository, not the automatically-generated code. |
No, I don't intend to use a parser generator. I put EBNF there to make sure the overall timelevel specification logic is consistent and complete, and there are no hidden surprises. |
@SamuelTrahanNOAA Thanks for the comments and discussions! This is the first version to get things work. I also feel the implementation is kind of complicated and I would like to descope to meet our current needs only. My thought is to limit the timelevel specifications to only support minutes and hours (may also limit the output to have to start at 0h). I intentionally try to avoid using the same time format |
It is, indeed, a finely-polished EBNF with perfect indentation. However, it doesn't describe the code. Your |
What is more user-friendly is splitting them into individual XML tags so it is clear what is going on. That would use the existing MPAS parsing code (eliminating the parser). Also, it'll be less confusing to experienced MPAS users. <output_interval start="01:15:00" stop="02:30:00" step="00:15:00"/> <!-- every 15 minutes from 1:15 to 2:30 -->
<output_interval start="06:00:00"/> <!-- Only at hour 6 -->I can see how your string would be easier to pass through the rrfs-workflow bash scripts, but bash limitations shouldn't take precedence over MPAS code consistency and quality. |
|
Can you please provide:
|
|
@clark-evans I am sorry, this may not be ready for an official review yet. I should have put this in the draft mode since the beginning. |
This looks good. Does current MPAS code support this? |
No. I'm suggesting it as an alternative implementation to your recursive descent parser. |
|
@SamuelTrahanNOAA Thanks for lots of great discussions! For the moment, this PR is mainly for a test/demo purpose. I think my initial need is much simpler that the goal in this PR. We want to output For our current needs, I think NCAR Andy Stokely's changes may work. I will test that first. I was not aware of Andy's changes until 2 days ago. |
|
WRF was limited to start...step...end for each stream. We were able to work around that by having multiple output streams. (Recall that the operational models HRRR, HWRF, NAM, and RAP were all WRF-based, along with other quasi-operational models.) |
|
@guoqing-noaa @SamuelTrahanNOAA For example, output_fh = 0.2 0.4 0.6 0.8 1 2 3 6 9 12, would provide output every 12min for the first hour, every hour for the next three hours, and every three hours for the remainder of the simulation. |
@dustinswales It is good to know this capability in UFS.
Thanks! |
I believe output_fh would be just need to be really long in this case,output_fh: 0.25 0.50 0.75 1 2 3 4 5 .... 72 75 78 .... 168 174 180 ... 240. I'm sure we could find a way to distill this information if it become a pain.
This is mostly true.
This is going to be the biggest change for Standalone users when moving to inline MPAS. We use the MPAS framework for native input/output, but we do not use the MPAS stream manager as is done in MPAS standalone. |
|
FYI: NOAA GSL doesn't do climate or seasonal research. Hence, the capability to output on multi-week timescales won't affect our work. It is a good question to ask, though, since others in NOAA do seasonal forecasts. I'd expect forecasts out to 90 days for some applications, just not ours. (I just wanted to clarify things since the word "climate" showed up in discussion.) |
@dustinswales I think it is totally fine to enumerate all output hours inside the model. However, it will be very beneficial for users for specify this using a simplified interface, for example, |
- parse the output_timelevels string only once at the beginning and store the results into MPAS_timelevel_spec_type for future use - adopt the mpas_split_string(...) function to do string parsing (Fortran 2023's split is NOT used as it is very new and may not be widely supported by compilers)
|
This PR is ready for review now.
(Fortran 2023's All the previous tests listed in post#3 worked as expected. We plan to use this PR for the upcoming Spring Forecast Experiment. Thanks! |
Introduce a new
output_timelevelsattribute for MPAS streams that enables variable output intervals.With this capability, we may outoput every 15 minutes in the first hour, every hour in the first 3 days, every 3 hours for the next 4 days, and every 6 hours in the last 3 days.
We can also use this to only write out forecast files during a given period, such as:
output_timelevels="6-12h"Check the PR description below for details on how to specify the time levles.
Here is a quick example:
output_timelevels="0-3-15m 4-72 75-168-3 174-240-6"FYI, with this PR, we may write out mpasout files at
"0 1 2 3 6 9 12", while history files at"4 5 7 8 11 13-99999"to avoid duplicate output of both mpasout and history files at the same time levels, which are almost the same.This PR solves issue #214
Priority Reviewers